//
//  Util.h
//  Zinipad
//
//  Created by ZeLkOvA on 12. 6. 20..
//  Copyright (c) 2012년 __MyCompanyName__. All rights reserved.
//

/**
 * 적용 방법
 * 1. Reachability.h와 Reachability.m 파일 추가 (인터넷 접속 여부 확인용)
 * 2. ASI 추가 (HTTPS 접속용)
 * 3. SBJSON 추가 (JSON Parser)
 * 
 * 추가할 framework
 * Reachablility/ASI 공통 : SystemConfiguration.framework
 * ASI : CFNetwork.framework, MobileCoreServices.framework, CoreGraphics.framework, libz.dylib
 */

#import <Foundation/Foundation.h>
#import "SBJSON.h"
#import "ASIFormDataRequest.h"

@interface Util : NSObject
{
    
}

+(UIColor*)hex2RGB:(NSString*)hexValue andAlpha:(float)alpha;
+(BOOL)checkNetworkEnable;
+(NSDictionary*)sendHTTPPost:(NSURL*)url sendData:(NSData*)data;
+(NSDictionary*)sendHTTPSPost:(NSURL *)url sendData:(NSArray *)dataArray;
+(NSDictionary*)sendHTTPGetWithParameter:(NSURL*)url;
+(NSDictionary*)sendHTTPSGetWithParameter:(NSURL*)url;
+(void)writeFileAtDir:(NSString*)dirName andFileName:(NSString*)fileName andData:(NSString*)data isOverWrite:(BOOL)isReplace;
+(NSString*)readFileAtDir:(NSString*)dirName andFileName:(NSString*)fileName;
+(void)deleteFileAtDir:(NSString*)dirName andFileName:(NSString*)fileName;
+(void)deleteAllFilesAtDir:(NSString*)dirName;
+(NSArray*)getFileList:(NSString*)dirName;
+(void)popModalsToFirstFrom:(UIViewController*)viewController;
+(int)getStringBytes:(NSString*)targetString;
+(UIImageView*)cropImage:(NSString*)targetImageName
                 targetX:(float)targetX targetY:(float)targetY targetWidth:(float)targetWidth targetHeight:(float)targetHeight
                 resultX:(float)resultX resultY:(float)resultY resultWidth:(float)resultWidth resultHeight:(float)resultHeight;
+(UIImageView*)tileImage:(NSString*)targetImageName resultX:(float)resultX resultY:(float)resultY resultWidth:(float)resultWidth resultHeight:(float)resultHeight;
+(NSInteger)findCategory:(int)_rootIndex sub:(int)_subIndex;
+(NSString*)findFloorRootCategoryName:(int)_index;
+(NSString*)findWallpaperRootCategoryName:(int)_index;
@end
